bb72c560bc7b92e1b5d664a38aefa8257d1b8c27,camel-core/src/main/java/org/apache/camel/model/rest/RestBindingDefinition.java,RestBindingDefinition,createProcessor,#RouteContext#,68
Before Change
DataFormat outJaxb;
name = context.getRestConfiguration().getXmlDataFormat();
if (name == null) {
// this will create a new instance as we use the default name
name = "jaxb";
jaxb = context.resolveDataFormat(name);
outJaxb = context.resolveDataFormat(name);
} else {
jaxb = context.resolveDataFormat(name);
After Change
@Override
public Processor createProcessor(RouteContext routeContext) throws Exception {
CamelContext context = routeContext.getCamelContext();
// the default binding mode can be overridden per rest verb
String mode = context.getRestConfiguration().getBindingMode().name();
if (bindingMode != null) {
mode = bindingMode.name();
}
// skip by default
boolean skip = skipBindingOnErrorCode == null || skipBindingOnErrorCode;
if (mode == null || "off".equals(mode)) {
// binding mode is off, so create a off mode binding processor
return new RestBindingProcessor(null, null, null, null, consumes, produces, mode, skip);
}
// setup json data format
String name = context.getRestConfiguration().getJsonDataFormat();
if (name != null) {
// must only be a name, not refer to an existing instance
Object instance = context.getRegistry().lookupByName(name);
if (instance != null) {
throw new IllegalArgumentException("JsonDataFormat name: " + name + " must not be an existing bean instance from the registry");
}
} else {
name = "json-jackson";
}
// this will create a new instance as the name was not already pre-created
DataFormat json = context.resolveDataFormat(name);
DataFormat outJson = context.resolveDataFormat(name);
// is json binding required?
if (mode.contains("json") && json == null) {